package com.zwy.alhorthms;

import java.util.Arrays;
import java.util.Random;

/**
 * @author 天火
 * @className Check
 */
public class Check {

     int arr1[] = new int[10000];

     static int[] arrCopy()
     {
         Random random = new Random();
         int arr1[] = new int[10000];
         for(int i = 0; i<arr1.length; i++){
             arr1[i] = random.nextInt(10000);
         }
         return arr1;
     }

     public static void check(){
         int[] arr = arrCopy();
         int[] array = new int[arr.length];
         System.arraycopy(arr,0,array,0,arr.length);

         Arrays.sort(array);
         //SelectionSort.sort(arr);
         BubbleSort.bubbleSort(arr);
         for(int i = 0; i<10000; i++){
             if(arr[i] != array[i]){
                 System.out.println("排序出错");
                 break;
             }
         }
         System.out.println("排序成功");


     }

    public static void main(String[] args) {
        check();

    }

}
